/*
 * testCanvasForm.java
 *
 * Created on 4 de Junho de 2007, 22:46
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.view;

import com.EntertainerMidlet;
import com.view.components.CanvasAnimate;
import com.view.components.CanvasColor;
import com.view.components.CanvasForm;
import com.view.components.CanvasLabel;
import com.view.components.CanvasListGroup;
import com.view.components.CanvasListItem;
import com.view.components.CanvasTextField;
import java.io.IOException;
import java.util.Vector;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

/**
 *
 * @author $Leandro$
 */
public class TestCanvasForm extends CanvasForm implements Runnable {
    
    public CanvasLabel lbHello;
    
    public CanvasAnimate loading;
    
    public Vector imgs;
    
    /** Creates a new instance of testCanvasForm */
    public TestCanvasForm(EntertainerMidlet midlet) {
        super(midlet);
        
        this.bgColor = new CanvasColor(0x6A82DB);
        try {
            
            this.backgroundImg = Image.createImage("/imgs/background.png");
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
    
    int i = 1;
    
    protected void paint(Graphics g) {
        /*g.setColor(bgColor.rgb);
        g.fillRect(0,0,getWidth(),getHeight());*/
        
        g.drawImage(this.backgroundImg,0,0,g.TOP|g.LEFT);
    }
    
    public void run() {
        int sleep_time = 120;
        try {
            while (true) {
                repaint();
                
                i++;
                i%=16;
                if(i == 0) i = 1;
                
                Thread.sleep(sleep_time);
            }
        } catch (InterruptedException ex) {
            ex.printStackTrace();
        }
    }
    
}
